﻿using System.Linq;
using Super_Management_Mayhem.Screens.Menu.CreateAvatarColor;
using Transformable_Engine_v2.Engine.Graphics;
using Transformable_Engine_v2.Engine.Helper;

namespace Super_Management_Mayhem.Screens.Playing.Players
{
    public class Team
    {
        public Team()
            : this(-1, "Unknown")
        {
            
        }

        public Team(int teamColor)
            : this(teamColor, TeamNameGenerator())
        {
        }

        public Team(int teamColor,
                    string teamName)
        {
            TeamColor = teamColor;
            Name = teamName;
        }

        public int TeamColor { get; set; }
        public string Name { get; private set; }

        public Color GetColor()
        {
            return AvatarColorMenu.AvailableColors[TeamColor];
        }

        #region Name Generator

        private static readonly string[] Adjectives = new[] {
                                                                //A
                                                                "Abandoned", "Aberrant", "Abiding", "Ablaze", "Able", "Abnormal", "Abrupt", "Absent", "Abundant", "Acidic", "Angry", "Amusing", "Amazing", "Awkward", "Average", "Avid",
                                                                //B
                                                                "Bad", "Beautiful", "Berserk", "Best", "Bloody", "Blushing", "Bored", "Bouncy", "Breakable", "Bright", "Bumpy", "Baby",
                                                                //C
                                                                "Calm", "Capable", "Careless", "Charming", "Cheap", "Cheerful", "Classy", "Clever", "Clumsy", "Colorful", "Cool", "Cold", "Cowardly", "Cute", "Crazy",
                                                                //D
                                                                "Dark", "Dead", "Deep", "Dear", "Demonic", "Depressed", "Deranged", "Delicious", "Dirty", "Discreet", "Dizzy", "Dry", "Doubtful", "Dysfunctional", "Drunken",
                                                                //E
                                                                "Earsplitting", "Easy", "Educated", "Efficient", "Electric", "Embarrassed", "Empty", "Enormous", "Excellent", "Exotic", "Expensive",
                                                                //F
                                                                "Fabulous", "Faithful", "Famous", "Fantastic", "Fast", "Fat", "Fierce", "Fearless", "Female", "Fluffy", "Foamy", "Foolish", "Fragile", "Funny", "Fuzzy", "Futuristic", "Frenzied", "Furious",
                                                                //G
                                                                "Great", "Groovy", "Greedy", "Grateful", "Guilty", "Gifted", "Glamorous", "Gorgeous", "Graceful", "Grumpy", "Gutsy", "Gullible", "Ghastly",
                                                                //H
                                                                "Handsome", "Handy", "Happy", "Hard", "Harsh", "Hateful", "Heavenly", "Heartbreaking", "Heavy", "Hellish", "Hilarious", "Historical", "Homeless", "Horrible", "Hungry", "Hungry Hungry", "Hysterical", "Hypnotic",
                                                                //I
                                                                "Icky", "Idiotic", "Ill", "Ill Tempered", "Ill Fated", "Imperfect", "Impolite", "Important", "Impossible", "Invincible", "Itchy", "Inquisitive", "Illegal",
                                                                //J
                                                                "Jaded", "Jazzy", "Jealous", "Jobless", "Jolly", "Judicious", "Juicy", "Juvenile", "Jumpy",
                                                                //K
                                                                "Keen", "Kind", "Karate", "Kindhearted", "Killer", "Knotty", "Knowledgeable", "Known",
                                                                //L
                                                                "Lame", "Laughable", "Lazy", "Legal", "Lethal", "Likeable", "Little", "Lonely", "Loose", "Lucky", "Loud", "Lying",
                                                                //M
                                                                "Male", "Mutated", "Macho", "Mad", "Massive", "Mature", "Mean", "Medical", "Melting", "Mighty", "Messy", "Mindless", "Modern", "Mysterious", "Mega",
                                                                //N
                                                                "Naive", "Nasty", "Narrow", "Natural", "Naughty", "Nebulous", "Nervous", "Noisy", "Normal", "Noxious", "Null", 
                                                                //O
                                                                "Obedient", "Obese", "Obnoxious", "Obsolete", "Odd", "Omniscient", "Open", "Ordinary", "Organic", "Outrageous", "Overconfident",
                                                                //P
                                                                "Painful", "Pale", "Parallel", "Perfect", "Periodic", "Physical", "Plain", "Plausible", "Pointless", "Poor", "Psychedelic", "Puny", "Puzzling", "Protective", "Private", "Proud",
                                                                //Q
                                                                "Questionable", "Quick", "Quirky", "Quizzical",
                                                                //R
                                                                "Rebel", "Receptive", "Remarkable", "Repulsive", "Resolute", "Rich", "Rough", "Rude", "Rustic", "Raging",
                                                                //S
                                                                "Sad", "Sassy", "Scary", "Screeching", "Secretive", "Selfish", "Shaky", "Swag", "Shiny", "Swift", "Silly", "Silent", "Slim", "Smelly", "Smooth", "Sneaky", "Sophisticated", "Spooky", "Sticky", "Strange", "Super", "Stupid",
                                                                //T
                                                                "Taboo", "Tacky", "Talented", "Tall", "Tasteful", "Tedious", "Tender", "Terrible", "Thick", "Tidy", "Thin", "Tough", "Toothsome", "True", "Typical", "Turbo",
                                                                //U
                                                                "Unspeakable", "Ubiquitous", "Ultra", "Unique", "Upset", "Useful", "Useless",
                                                                //V
                                                                "Vague", "Valuable", "Venomous", "Violent", "Vigorous", "Victorious", "Vulgar",
                                                                //W
                                                                "Wacky", "Warm", "Weak", "Wet", "Whimsical", "Wicked", "Wiggly", "Wasteful", "Witty", "Wooden", "Worthless", "Wrong", "Wireless",
                                                                //X
                                                                //Y
                                                                "Young", "Youthful", "Yummy",
                                                                //Z
                                                                "Zealous", "Zesty"
                                                            };

        private static readonly string[] Noun = new[] {
                                                          //A
                                                          "Actors", "Airplanes", "Animals", "Authorities", "Angels", "Automatons", "Artists",
                                                          //B
                                                          "Babies", "Businessmen", "Believers", "Brothers", "Brawlers", "Band",
                                                          //C
                                                          "Caretakers", "Calculators", "Cannons", "Children", "Conquerors", "Crybabies",
                                                          //D
                                                          "Dreamers", "Dinosaurs", "Destroyers", "Doctors", "Dogs", "Dictators", "Devils", "Demons", "Dopes",
                                                          //E
                                                          "Eradicators", "Eyes", "Elite", "Eaters", "Elderly", "Experts", "Emperors",
                                                          //F
                                                          "Fingers", "Fighters", "Fools",
                                                          //G
                                                          "Gamers", "Gentlemen", "Gamblers", "Group", "Gang", "Ghosts",
                                                          //H
                                                          "Helpers", "Horrors", "Helicopters", "Hunters", "Hippos",
                                                          //I
                                                          "Immigrants",
                                                          //J
                                                          "Jumpers", "Juices", "Juveniles", "Jesters",
                                                          //K
                                                          "Kids", "Kings",
                                                          //L
                                                          "Leprechauns", "Lawyers", "Lovers", 
                                                          //M
                                                          "Musicians", "Monsters", "Masters", "Men",
                                                          //N
                                                          "Noodles",
                                                          //O
                                                          "Ones", "Oddities",
                                                          //P
                                                          "People", "Professionnals", "Primates",
                                                          //Q
                                                          //R
                                                          "Runners", "Risktakers", "Robots",
                                                          //S
                                                          "Sea Bass", "Spoons", "Sore Losers", "Scientists",
                                                          //T
                                                          "Talkers", "Teenagers", "Tigers", "Terrorists", "Team",
                                                          //U
                                                          "Undying",
                                                          //V
                                                          "Vagabonds", "Vipers", "Vandals",
                                                          //W
                                                          "Winners", "Wine Tasters", "Whisperer", "Witches",
                                                          //X
                                                          //Y
                                                          "Yankees",
                                                          //Z
                                                      };

        private static string TeamNameGenerator()
        {
            string noun = Noun[Randomizer.Int(0, Noun.Length - 1)];
            string adjective = Adjectives[Randomizer.Int(0, Adjectives.Length - 1)];

            return string.Format("The {0} {1}", adjective, noun);
        }

        #endregion
    }
}